home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-03-10 | 8.0 KB | 268 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* MULTI-RAINBOWS-DEMO *
- '* for V1.1 and over *
- '* *
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '* & F.Lionet *
- '***************************
- '
- Rem *** reserve some memory for the arrays
- '
- Dim C(3),CC(3,279)
- Global C(),CC(),NRAIN
- NRAIN=3
- Rem *** define colours to be affected
- '
- C(0)=1 : C(1)=2 : C(2)=3
- Rem *** read the data into the arrays
- '
- For N=0 To NRAIN-1
- Restore "Rn"+Mid$(Str$(N),2)
- For C=0 To 279
- Read CC(C(N),C)
- Next
- Next
- Rem *** load the screen to be displayed
- '
- Load Iff "AMOSPro_Tutorial:IFF/Window.iff",0
- Screen Open 1,640,32,2,Hires : Curs Off : Flash Off : Hide
- Palette $22,$CC : Screen Display 1,,140,,
- Locate 0,1 : Centre "This is the screen before the multi-rainbows"
- Cdown : Centre "Press any mouse key to see the effect."
- Repeat : Wait 5 : Until Mouse Key : Screen Close 1
- '
- Rem *** call the multi_rainbow procedure
- '
- _MULTIPLE_RAINBOWS[30]
- '
- Repeat : Until Mouse Key
- Copper On : Wait 50 : Fade 2 : Wait 30
- Edit
- '
- Procedure _MULTIPLE_RAINBOWS[Y]
-
- ' Ensure the display is stable
- Wait Vbl : View : Wait Vbl : View : Wait Vbl
-
- ' Copy the actual copper list in a memory bank
- Reserve As Work 10,11*1024
- L=0
- Repeat
-
- C=Leek(Cop Logic+L)
- Loke Start(10)+L,C
- L=L+4
-
- Until C=$FFFFFFFE
-
- ' No more copper
- Copper Off : Wait Vbl
-
- ' Where to poke the new list
- ACOP=Cop Logic : ACH=Start(10)
-
- ' Copy the sprites definitions
- Cop Move 0,0
- Loke ACOP,Leek(ACH)
- Add ACOP,4 : Add ACH,4
- For N=0 To 15
- Cop Move 0,0
- Loke ACOP,Leek(ACH)
- Add ACOP,4 : Add ACH,4
- Next
-
- ' Copper-list creation loop
- Y=30 : YRAIN=0
- Do
-
- ' Wait for the first line
- Cop Wait 7,Y : ACOP=ACOP+4
-
- ' Get the first position from AMOS list
- CY=Deek(ACH)/256+YBASE
-
- If Y=CY
-
- ' We take the first instruction in AMOS original
- ' copper list. This instruction is a WAIT...
- ACH=ACH+4 : C1=Deek(ACH)
-
- If(C1 and 1)=0
-
- ' We are defining a new screen. Best solution is
- ' to copy the original definition. We must only
- ' change the colours according to the new rainbows...
- Do
-
- C1=Deek(ACH) : C2=Deek(ACH+2)
-
- Exit If(C1 and 1)<>0
-
- ' Is the colour copied a colour included in one
- ' of the rainbow?
- For C=0 To NRAIN-1
- If C1=C(C)*2+$180
- C2=CC(C(C),YRAIN)
- End If
- Next
-
- Add ACH,4
- Cop Move 0,0
- Doke ACOP,C1 : Doke ACOP+2,C2 : Add ACOP,4
-
- Loop
- End If
-
- Else
-
- ' It is not a screen, lets simply put the current
- ' colours for all the rainbows
- For C=0 To NRAIN-1
- Cop Move $180+C(C)*2,CC(C(C),YRAIN) : Add ACOP,4
- Next
-
- End If
-
- ' Next line
- Inc Y : Inc YRAIN
-
- ' In PAL, lets skip the 255 wait
- If Y=256 : YBASE=256 : End If
-
- ' When do we exit?
- Exit If Y>311
- Exit If YRAIN>279
- Exit If ACOP-Cop Logic>10*1024
-
- Loop
-
- ' The end of the list!
- Cop Wait 255,255
-
- ' Everything is finished, lets display it
- Cop Swap : Wait Vbl
- End Proc
- '
- Rem *** the first rainbow definition
- '
- RN0:
- Data $A00,$900,$800,$700,$600,$500,$400,$300
- Data $200,$100,$600,$600,$600,$600,$600,$300
- Data $400,$500,$600,$700,$800,$900,$A00,$A00
- Data $900,$800,$700,$600,$500,$400,$300,$200
- Data $100,$600,$600,$600,$600,$600,$300,$400
- Data $500,$600,$700,$800,$900,$A00,$A00,$900
- Data $800,$700,$600,$500,$400,$300,$200,$100
- Data $600,$600,$600,$600,$600,$300,$400,$500
- Data $600,$700,$800,$900,$A00,$A00,$900,$800
- Data $700,$600,$500,$400,$300,$200,$100,$600
- Data $600,$600,$600,$600,$300,$400,$500,$600
- Data $700,$800,$900,$A00,$A00,$900,$800,$700
- Data $600,$500,$400,$300,$200,$100,$600,$600
- Data $600,$600,$600,$300,$400,$500,$600,$700
- Data $800,$900,$A00,$A00,$900,$800,$700,$600
- Data $500,$400,$300,$200,$100,$600,$600,$600
- Data $600,$600,$300,$400,$500,$600,$700,$800
- Data $900,$A00,$A00,$900,$800,$700,$600,$500
- Data $400,$300,$200,$100,$600,$600,$600,$600
- Data $600,$300,$400,$500,$600,$700,$800,$900
- Data $A00,$A00,$900,$800,$700,$600,$500,$400
- Data $300,$200,$100,$600,$600,$600,$600,$600
- Data $300,$400,$500,$600,$700,$800,$900,$A00
- Data $A00,$900,$800,$700,$600,$500,$400,$300
- Data $200,$100,$600,$600,$600,$600,$600,$300
- Data $400,$500,$600,$700,$800,$900,$A00,$A00
- Data $900,$800,$700,$600,$500,$400,$300,$200
- Data $100,$600,$600,$600,$600,$600,$300,$400
- Data $500,$600,$700,$800,$900,$A00,$A00,$900
- Data $800,$700,$600,$500,$400,$300,$200,$100
- Data $600,$600,$600,$600,$600,$300,$400,$500
- Data $600,$700,$800,$900,$A00,$A00,$900,$800
- Data $700,$600,$500,$400,$300,$200,$100,$600
- Data $600,$600,$600,$600,$300,$400,$500,$600
- Data $700,$800,$900,$A00,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- '
- Rem *** the second rainbow definition
- '
- RN1:
- Data $BEE,$CC,$CC,$CC,$BEE,$CC,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $CC,$CC,$CC,$BEE,$CC,$CC,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $CC,$CC,$BEE,$CC,$CC,$CC,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $CC,$BEE,$CC,$CC,$CC,$CC,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $BEE,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$BEE,$CC,$CC
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$BEE
- Data $CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC
- Data $BEE,$CC,$CC,$CC,$CC,$CC,$CC,$BEE
- Data $CC,$CC,$CC,$CC,$BEE,$CC,$CC,$CC
- Data $BEE,$CC,$CC,$BEE,$CC,$BEE,$CC,$BEE
- Data $CC,$BEE,$CC,$BEE,$BEE,$BEE,$BEE,$BEE
- Data $BEE,$CC,$BEE,$BEE,$BEE,$CC,$BEE,$BEE
- Data $BEE,$BEE,$BEE,$CC,$BEE,$BEE,$BEE,$BEE
- Data $BEE,$AEE,$9EE,$8EE,$8EE,$7EE,$6EE,$5EE
- Data $4EE,$3EE,$3EE,$2EE,$2EE,$1DD,$1DD,$4CF
- Data $0,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
- Data $2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
- Data $2A1,$80,$11,$55,$55,$55,$55,$55
- Data $55,$55,$9AA,$55,$55,$55,$55,$55
- Data $55,$55,$11,$80,$80,$2A1,$2A1,$2A1
- Data $2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
- Data $2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
- Data $2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1,$2A1
- Data $2A1,$2A1,$2A1,$2A1,$EE0,$CC0,$AA0,$880
- Data $660,$E0E,$C0C,$A0A,$808,$606,$EE,$CC
- Data $AA,$88,$66,$2A1,$2A1,$2A1,$EE0,$CC0
- Data $AA0,$880,$660,$E0E,$C0C,$A0A,$808,$606
- Data $EE,$CC,$AA,$88,$66,$2A1,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- '
- Rem *** the final rainbow definition
- '
- RN2:
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$F61,$E50,$F61,$E50
- Data $F61,$E50,$D40,$F61,$E50,$D40,$F61,$E50
- Data $D40,$C30,$F61,$E50,$D40,$C30,$F61,$E50
- Data $D40,$C30,$B20,$F61,$E50,$D40,$C30,$B20
- Data $F61,$E50,$D40,$C30,$B20,$A10,$F61,$E50
- Data $D40,$C30,$B20,$A10,$F61,$E50,$D40,$C30
- Data $B20,$A10,$900,$F61,$E50,$D40,$C30,$B20
- Data $A10,$900,$F61,$E50,$D40,$C30,$B20,$A10
- Data $900,$800,$F61,$E50,$D40,$C30,$B20,$A10
- Data $900,$800,$F61,$E50,$D40,$C30,$B20,$A10
- Data $EEE,$DDD,$EEE,$DDD,$EEE,$DDD,$CCC,$EEE
- Data $DDD,$CCC,$EEE,$DDD,$CCC,$BBB,$EEE,$DDD
- Data $CCC,$BBB,$EEE,$DDD,$CCC,$BBB,$AAA,$EEE
- Data $DDD,$CCC,$BBB,$AAA,$EEE,$DDD,$CCC,$BBB
- Data $AAA,$999,$EEE,$DDD,$CCC,$BBB,$AAA,$999
- Data $EEE,$DDD,$CCC,$BBB,$AAA,$999,$888,$EEE
- Data $DDD,$CCC,$BBB,$AAA,$999,$888,$EEE,$DDD
- Data $CCC,$BBB,$AAA,$999,$888,$777,$EEE,$DDD
- Data $CCC,$BBB,$AAA,$999,$888,$777,$EEE,$DDD
- Data $CCC,$BBB,$AAA,$999,$888,$777,$666,$555
- Data $444,$333,$222,$111,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0
- Data $0,$0,$0,$0,$0,$0,$0,$0